package cn.ibizlab.odoo.core.odoo_stock.service.impl;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.math.BigInteger;
import java.util.Collection;

import lombok.extern.slf4j.Slf4j;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import cn.ibizlab.odoo.core.client.model.Istock_warehouse;
import cn.ibizlab.odoo.core.odoo_stock.domain.Stock_warehouse;
import cn.ibizlab.odoo.core.odoo_stock.filter.Stock_warehouseSearchContext;
import cn.ibizlab.odoo.core.odoo_stock.service.IStock_warehouseService;
import cn.ibizlab.odoo.util.SearchResult;
import cn.ibizlab.odoo.util.log.IBIZLog;

/**
 * 实体[仓库] 服务对象接口实现
 */
@Slf4j
@IBIZLog
@Service
public class Stock_warehouseServiceImpl implements IStock_warehouseService {

    @Autowired
    private cn.ibizlab.odoo.core.client.service.Istock_warehouseClientService stock_warehouseClientService;

    @Override
    public Stock_warehouse get(Integer id) {
        Istock_warehouse clientModel = stock_warehouseClientService.createModel();
        clientModel.setId(id);
        stock_warehouseClientService.get(clientModel) ;
        return this.convert2Domain(clientModel,null);
    }

    @Override
    public Stock_warehouse get(Stock_warehouse stock_warehouse) {
        Stock_warehouse retstock_warehouse = this.get(stock_warehouse.getId()) ;
    	BeanCopier copier=BeanCopier.create(retstock_warehouse.getClass(), stock_warehouse.getClass(), false);
        copier.copy(retstock_warehouse, stock_warehouse, null);
        return stock_warehouse ;
    }

    @Override
    public void removeBatch(Collection<? extends Serializable> idList, int batchSize) {

        //stock_warehouseClientService.removeBatch(stock_warehouses) ;

    }

    @Override
    public boolean create(Stock_warehouse stock_warehouse) {
        boolean bOk = false ;
        Istock_warehouse clientModel = this.convert2Model(stock_warehouse,null);
        stock_warehouseClientService.create(clientModel) ;
        this.convert2Domain(clientModel,stock_warehouse);
        bOk = true ;

        return bOk ;
    }

    @Override
    public boolean update(Stock_warehouse stock_warehouse) {
        boolean bOk = false ;
        Istock_warehouse clientModel = this.convert2Model(stock_warehouse,null);
        stock_warehouseClientService.update(clientModel) ;
        this.convert2Domain(clientModel,stock_warehouse) ;
        bOk = true;
        return bOk ;
    }

    @Override
    public void createBatch(List<Stock_warehouse> stock_warehouses, int batchSize) {

                        //stock_warehouseClientService.createBatch(stock_warehouses,batchSize) ;

    }

    @Override
    public void updateBatch(List<Stock_warehouse> stock_warehouses, int batchSize) {

        //stock_warehouseClientService.updateBatch(stock_warehouses,batchSize) ;

    }

    @Override
    public boolean remove(Integer id) {
        boolean bOk = false ;
        Istock_warehouse clientModel = stock_warehouseClientService.createModel();
        clientModel.setId(id);
        stock_warehouseClientService.remove(clientModel) ;
        bOk = true ;
        return bOk ;
    }

    /**
     * 查询集合 默认查询
     */
    @Override
    public Page<Stock_warehouse> searchDefault(Stock_warehouseSearchContext context) {
        List<Stock_warehouse> list = new ArrayList<Stock_warehouse>();
        Page<cn.ibizlab.odoo.core.client.model.Istock_warehouse> clientModelList = stock_warehouseClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Istock_warehouse clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Stock_warehouse>(list, context.getPageable(), clientModelList.getTotalElements());
    }


    /**
     * 根据公司查询
     */
    @Override
    public Page<Stock_warehouse> selectByOdoo_company(Integer id){
        Stock_warehouseSearchContext context = new Stock_warehouseSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Stock_warehouse> list = new ArrayList<Stock_warehouse>();
        Page<cn.ibizlab.odoo.core.client.model.Istock_warehouse> clientModelList = stock_warehouseClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Istock_warehouse clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Stock_warehouse>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据联系人查询
     */
    @Override
    public Page<Stock_warehouse> selectByOdoo_partner(Integer id){
        Stock_warehouseSearchContext context = new Stock_warehouseSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Stock_warehouse> list = new ArrayList<Stock_warehouse>();
        Page<cn.ibizlab.odoo.core.client.model.Istock_warehouse> clientModelList = stock_warehouseClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Istock_warehouse clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Stock_warehouse>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据用户查询
     */
    @Override
    public Page<Stock_warehouse> selectByOdoo_create(Integer id){
        Stock_warehouseSearchContext context = new Stock_warehouseSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Stock_warehouse> list = new ArrayList<Stock_warehouse>();
        Page<cn.ibizlab.odoo.core.client.model.Istock_warehouse> clientModelList = stock_warehouseClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Istock_warehouse clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Stock_warehouse>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据用户查询
     */
    @Override
    public Page<Stock_warehouse> selectByOdoo_write(Integer id){
        Stock_warehouseSearchContext context = new Stock_warehouseSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Stock_warehouse> list = new ArrayList<Stock_warehouse>();
        Page<cn.ibizlab.odoo.core.client.model.Istock_warehouse> clientModelList = stock_warehouseClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Istock_warehouse clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Stock_warehouse>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据库存路线查询
     */
    @Override
    public Page<Stock_warehouse> selectByOdoo_crossdock_route(Integer id){
        Stock_warehouseSearchContext context = new Stock_warehouseSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Stock_warehouse> list = new ArrayList<Stock_warehouse>();
        Page<cn.ibizlab.odoo.core.client.model.Istock_warehouse> clientModelList = stock_warehouseClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Istock_warehouse clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Stock_warehouse>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据库存路线查询
     */
    @Override
    public Page<Stock_warehouse> selectByOdoo_delivery_route(Integer id){
        Stock_warehouseSearchContext context = new Stock_warehouseSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Stock_warehouse> list = new ArrayList<Stock_warehouse>();
        Page<cn.ibizlab.odoo.core.client.model.Istock_warehouse> clientModelList = stock_warehouseClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Istock_warehouse clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Stock_warehouse>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据库存路线查询
     */
    @Override
    public Page<Stock_warehouse> selectByOdoo_pbm_route(Integer id){
        Stock_warehouseSearchContext context = new Stock_warehouseSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Stock_warehouse> list = new ArrayList<Stock_warehouse>();
        Page<cn.ibizlab.odoo.core.client.model.Istock_warehouse> clientModelList = stock_warehouseClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Istock_warehouse clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Stock_warehouse>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据库存路线查询
     */
    @Override
    public Page<Stock_warehouse> selectByOdoo_reception_route(Integer id){
        Stock_warehouseSearchContext context = new Stock_warehouseSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Stock_warehouse> list = new ArrayList<Stock_warehouse>();
        Page<cn.ibizlab.odoo.core.client.model.Istock_warehouse> clientModelList = stock_warehouseClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Istock_warehouse clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Stock_warehouse>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据库存位置查询
     */
    @Override
    public Page<Stock_warehouse> selectByOdoo_lot_stock(Integer id){
        Stock_warehouseSearchContext context = new Stock_warehouseSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Stock_warehouse> list = new ArrayList<Stock_warehouse>();
        Page<cn.ibizlab.odoo.core.client.model.Istock_warehouse> clientModelList = stock_warehouseClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Istock_warehouse clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Stock_warehouse>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据库存位置查询
     */
    @Override
    public Page<Stock_warehouse> selectByOdoo_pbm_loc(Integer id){
        Stock_warehouseSearchContext context = new Stock_warehouseSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Stock_warehouse> list = new ArrayList<Stock_warehouse>();
        Page<cn.ibizlab.odoo.core.client.model.Istock_warehouse> clientModelList = stock_warehouseClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Istock_warehouse clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Stock_warehouse>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据库存位置查询
     */
    @Override
    public Page<Stock_warehouse> selectByOdoo_sam_loc(Integer id){
        Stock_warehouseSearchContext context = new Stock_warehouseSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Stock_warehouse> list = new ArrayList<Stock_warehouse>();
        Page<cn.ibizlab.odoo.core.client.model.Istock_warehouse> clientModelList = stock_warehouseClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Istock_warehouse clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Stock_warehouse>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据库存位置查询
     */
    @Override
    public Page<Stock_warehouse> selectByOdoo_view_location(Integer id){
        Stock_warehouseSearchContext context = new Stock_warehouseSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Stock_warehouse> list = new ArrayList<Stock_warehouse>();
        Page<cn.ibizlab.odoo.core.client.model.Istock_warehouse> clientModelList = stock_warehouseClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Istock_warehouse clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Stock_warehouse>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据库存位置查询
     */
    @Override
    public Page<Stock_warehouse> selectByOdoo_wh_input_stock_loc(Integer id){
        Stock_warehouseSearchContext context = new Stock_warehouseSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Stock_warehouse> list = new ArrayList<Stock_warehouse>();
        Page<cn.ibizlab.odoo.core.client.model.Istock_warehouse> clientModelList = stock_warehouseClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Istock_warehouse clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Stock_warehouse>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据库存位置查询
     */
    @Override
    public Page<Stock_warehouse> selectByOdoo_wh_output_stock_loc(Integer id){
        Stock_warehouseSearchContext context = new Stock_warehouseSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Stock_warehouse> list = new ArrayList<Stock_warehouse>();
        Page<cn.ibizlab.odoo.core.client.model.Istock_warehouse> clientModelList = stock_warehouseClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Istock_warehouse clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Stock_warehouse>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据库存位置查询
     */
    @Override
    public Page<Stock_warehouse> selectByOdoo_wh_pack_stock_loc(Integer id){
        Stock_warehouseSearchContext context = new Stock_warehouseSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Stock_warehouse> list = new ArrayList<Stock_warehouse>();
        Page<cn.ibizlab.odoo.core.client.model.Istock_warehouse> clientModelList = stock_warehouseClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Istock_warehouse clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Stock_warehouse>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据库存位置查询
     */
    @Override
    public Page<Stock_warehouse> selectByOdoo_wh_qc_stock_loc(Integer id){
        Stock_warehouseSearchContext context = new Stock_warehouseSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Stock_warehouse> list = new ArrayList<Stock_warehouse>();
        Page<cn.ibizlab.odoo.core.client.model.Istock_warehouse> clientModelList = stock_warehouseClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Istock_warehouse clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Stock_warehouse>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据拣货类型查询
     */
    @Override
    public Page<Stock_warehouse> selectByOdoo_int_type(Integer id){
        Stock_warehouseSearchContext context = new Stock_warehouseSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Stock_warehouse> list = new ArrayList<Stock_warehouse>();
        Page<cn.ibizlab.odoo.core.client.model.Istock_warehouse> clientModelList = stock_warehouseClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Istock_warehouse clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Stock_warehouse>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据拣货类型查询
     */
    @Override
    public Page<Stock_warehouse> selectByOdoo_in_type(Integer id){
        Stock_warehouseSearchContext context = new Stock_warehouseSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Stock_warehouse> list = new ArrayList<Stock_warehouse>();
        Page<cn.ibizlab.odoo.core.client.model.Istock_warehouse> clientModelList = stock_warehouseClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Istock_warehouse clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Stock_warehouse>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据拣货类型查询
     */
    @Override
    public Page<Stock_warehouse> selectByOdoo_manu_type(Integer id){
        Stock_warehouseSearchContext context = new Stock_warehouseSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Stock_warehouse> list = new ArrayList<Stock_warehouse>();
        Page<cn.ibizlab.odoo.core.client.model.Istock_warehouse> clientModelList = stock_warehouseClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Istock_warehouse clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Stock_warehouse>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据拣货类型查询
     */
    @Override
    public Page<Stock_warehouse> selectByOdoo_out_type(Integer id){
        Stock_warehouseSearchContext context = new Stock_warehouseSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Stock_warehouse> list = new ArrayList<Stock_warehouse>();
        Page<cn.ibizlab.odoo.core.client.model.Istock_warehouse> clientModelList = stock_warehouseClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Istock_warehouse clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Stock_warehouse>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据拣货类型查询
     */
    @Override
    public Page<Stock_warehouse> selectByOdoo_pack_type(Integer id){
        Stock_warehouseSearchContext context = new Stock_warehouseSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Stock_warehouse> list = new ArrayList<Stock_warehouse>();
        Page<cn.ibizlab.odoo.core.client.model.Istock_warehouse> clientModelList = stock_warehouseClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Istock_warehouse clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Stock_warehouse>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据拣货类型查询
     */
    @Override
    public Page<Stock_warehouse> selectByOdoo_pbm_type(Integer id){
        Stock_warehouseSearchContext context = new Stock_warehouseSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Stock_warehouse> list = new ArrayList<Stock_warehouse>();
        Page<cn.ibizlab.odoo.core.client.model.Istock_warehouse> clientModelList = stock_warehouseClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Istock_warehouse clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Stock_warehouse>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据拣货类型查询
     */
    @Override
    public Page<Stock_warehouse> selectByOdoo_pick_type(Integer id){
        Stock_warehouseSearchContext context = new Stock_warehouseSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Stock_warehouse> list = new ArrayList<Stock_warehouse>();
        Page<cn.ibizlab.odoo.core.client.model.Istock_warehouse> clientModelList = stock_warehouseClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Istock_warehouse clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Stock_warehouse>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据拣货类型查询
     */
    @Override
    public Page<Stock_warehouse> selectByOdoo_sam_type(Integer id){
        Stock_warehouseSearchContext context = new Stock_warehouseSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Stock_warehouse> list = new ArrayList<Stock_warehouse>();
        Page<cn.ibizlab.odoo.core.client.model.Istock_warehouse> clientModelList = stock_warehouseClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Istock_warehouse clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Stock_warehouse>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据库存规则查询
     */
    @Override
    public Page<Stock_warehouse> selectByOdoo_buy_pull(Integer id){
        Stock_warehouseSearchContext context = new Stock_warehouseSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Stock_warehouse> list = new ArrayList<Stock_warehouse>();
        Page<cn.ibizlab.odoo.core.client.model.Istock_warehouse> clientModelList = stock_warehouseClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Istock_warehouse clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Stock_warehouse>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据库存规则查询
     */
    @Override
    public Page<Stock_warehouse> selectByOdoo_manufacture_pull(Integer id){
        Stock_warehouseSearchContext context = new Stock_warehouseSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Stock_warehouse> list = new ArrayList<Stock_warehouse>();
        Page<cn.ibizlab.odoo.core.client.model.Istock_warehouse> clientModelList = stock_warehouseClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Istock_warehouse clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Stock_warehouse>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据库存规则查询
     */
    @Override
    public Page<Stock_warehouse> selectByOdoo_mto_pull(Integer id){
        Stock_warehouseSearchContext context = new Stock_warehouseSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Stock_warehouse> list = new ArrayList<Stock_warehouse>();
        Page<cn.ibizlab.odoo.core.client.model.Istock_warehouse> clientModelList = stock_warehouseClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Istock_warehouse clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Stock_warehouse>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据库存规则查询
     */
    @Override
    public Page<Stock_warehouse> selectByOdoo_pbm_mto_pull(Integer id){
        Stock_warehouseSearchContext context = new Stock_warehouseSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Stock_warehouse> list = new ArrayList<Stock_warehouse>();
        Page<cn.ibizlab.odoo.core.client.model.Istock_warehouse> clientModelList = stock_warehouseClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Istock_warehouse clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Stock_warehouse>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据库存规则查询
     */
    @Override
    public Page<Stock_warehouse> selectByOdoo_sam_rule(Integer id){
        Stock_warehouseSearchContext context = new Stock_warehouseSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Stock_warehouse> list = new ArrayList<Stock_warehouse>();
        Page<cn.ibizlab.odoo.core.client.model.Istock_warehouse> clientModelList = stock_warehouseClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Istock_warehouse clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Stock_warehouse>(list, context.getPageable(), clientModelList.getTotalElements());

    }



    public Istock_warehouse convert2Model(Stock_warehouse domain , Istock_warehouse model) {
        if(domain == null)
            return model ;
        if(model==null){
            model = stock_warehouseClientService.createModel() ;
        }

         if(domain.getResupply_route_idsDirtyFlag())
            model.setResupply_route_ids(domain.getResupply_route_ids());
         if(domain.getActiveDirtyFlag())
            model.setActive(domain.getActive());
         if(domain.getResupply_wh_idsDirtyFlag())
            model.setResupply_wh_ids(domain.getResupply_wh_ids());
         if(domain.getWrite_dateDirtyFlag())
            model.setWrite_date(domain.getWrite_date());
         if(domain.get__last_updateDirtyFlag())
            model.set__last_update(domain.get__last_update());
         if(domain.getNameDirtyFlag())
            model.setName(domain.getName());
         if(domain.getDelivery_stepsDirtyFlag())
            model.setDelivery_steps(domain.getDelivery_steps());
         if(domain.getWarehouse_countDirtyFlag())
            model.setWarehouse_count(domain.getWarehouse_count());
         if(domain.getManufacture_to_resupplyDirtyFlag())
            model.setManufacture_to_resupply(domain.getManufacture_to_resupply());
         if(domain.getCreate_dateDirtyFlag())
            model.setCreate_date(domain.getCreate_date());
         if(domain.getRoute_idsDirtyFlag())
            model.setRoute_ids(domain.getRoute_ids());
         if(domain.getDisplay_nameDirtyFlag())
            model.setDisplay_name(domain.getDisplay_name());
         if(domain.getReception_stepsDirtyFlag())
            model.setReception_steps(domain.getReception_steps());
         if(domain.getBuy_to_resupplyDirtyFlag())
            model.setBuy_to_resupply(domain.getBuy_to_resupply());
         if(domain.getIdDirtyFlag())
            model.setId(domain.getId());
         if(domain.getCodeDirtyFlag())
            model.setCode(domain.getCode());
         if(domain.getManufacture_stepsDirtyFlag())
            model.setManufacture_steps(domain.getManufacture_steps());
         if(domain.getShow_resupplyDirtyFlag())
            model.setShow_resupply(domain.getShow_resupply());
         if(domain.getView_location_id_textDirtyFlag())
            model.setView_location_id_text(domain.getView_location_id_text());
         if(domain.getWh_input_stock_loc_id_textDirtyFlag())
            model.setWh_input_stock_loc_id_text(domain.getWh_input_stock_loc_id_text());
         if(domain.getSam_loc_id_textDirtyFlag())
            model.setSam_loc_id_text(domain.getSam_loc_id_text());
         if(domain.getCrossdock_route_id_textDirtyFlag())
            model.setCrossdock_route_id_text(domain.getCrossdock_route_id_text());
         if(domain.getPbm_route_id_textDirtyFlag())
            model.setPbm_route_id_text(domain.getPbm_route_id_text());
         if(domain.getWrite_uid_textDirtyFlag())
            model.setWrite_uid_text(domain.getWrite_uid_text());
         if(domain.getPbm_type_id_textDirtyFlag())
            model.setPbm_type_id_text(domain.getPbm_type_id_text());
         if(domain.getPick_type_id_textDirtyFlag())
            model.setPick_type_id_text(domain.getPick_type_id_text());
         if(domain.getInt_type_id_textDirtyFlag())
            model.setInt_type_id_text(domain.getInt_type_id_text());
         if(domain.getManu_type_id_textDirtyFlag())
            model.setManu_type_id_text(domain.getManu_type_id_text());
         if(domain.getBuy_pull_id_textDirtyFlag())
            model.setBuy_pull_id_text(domain.getBuy_pull_id_text());
         if(domain.getWh_pack_stock_loc_id_textDirtyFlag())
            model.setWh_pack_stock_loc_id_text(domain.getWh_pack_stock_loc_id_text());
         if(domain.getManufacture_pull_id_textDirtyFlag())
            model.setManufacture_pull_id_text(domain.getManufacture_pull_id_text());
         if(domain.getReception_route_id_textDirtyFlag())
            model.setReception_route_id_text(domain.getReception_route_id_text());
         if(domain.getDelivery_route_id_textDirtyFlag())
            model.setDelivery_route_id_text(domain.getDelivery_route_id_text());
         if(domain.getSam_type_id_textDirtyFlag())
            model.setSam_type_id_text(domain.getSam_type_id_text());
         if(domain.getPartner_id_textDirtyFlag())
            model.setPartner_id_text(domain.getPartner_id_text());
         if(domain.getOut_type_id_textDirtyFlag())
            model.setOut_type_id_text(domain.getOut_type_id_text());
         if(domain.getMto_pull_id_textDirtyFlag())
            model.setMto_pull_id_text(domain.getMto_pull_id_text());
         if(domain.getCreate_uid_textDirtyFlag())
            model.setCreate_uid_text(domain.getCreate_uid_text());
         if(domain.getLot_stock_id_textDirtyFlag())
            model.setLot_stock_id_text(domain.getLot_stock_id_text());
         if(domain.getPbm_mto_pull_id_textDirtyFlag())
            model.setPbm_mto_pull_id_text(domain.getPbm_mto_pull_id_text());
         if(domain.getCompany_id_textDirtyFlag())
            model.setCompany_id_text(domain.getCompany_id_text());
         if(domain.getPbm_loc_id_textDirtyFlag())
            model.setPbm_loc_id_text(domain.getPbm_loc_id_text());
         if(domain.getPack_type_id_textDirtyFlag())
            model.setPack_type_id_text(domain.getPack_type_id_text());
         if(domain.getSam_rule_id_textDirtyFlag())
            model.setSam_rule_id_text(domain.getSam_rule_id_text());
         if(domain.getIn_type_id_textDirtyFlag())
            model.setIn_type_id_text(domain.getIn_type_id_text());
         if(domain.getWh_output_stock_loc_id_textDirtyFlag())
            model.setWh_output_stock_loc_id_text(domain.getWh_output_stock_loc_id_text());
         if(domain.getWh_qc_stock_loc_id_textDirtyFlag())
            model.setWh_qc_stock_loc_id_text(domain.getWh_qc_stock_loc_id_text());
         if(domain.getWh_output_stock_loc_idDirtyFlag())
            model.setWh_output_stock_loc_id(domain.getWh_output_stock_loc_id());
         if(domain.getWrite_uidDirtyFlag())
            model.setWrite_uid(domain.getWrite_uid());
         if(domain.getPbm_loc_idDirtyFlag())
            model.setPbm_loc_id(domain.getPbm_loc_id());
         if(domain.getView_location_idDirtyFlag())
            model.setView_location_id(domain.getView_location_id());
         if(domain.getOut_type_idDirtyFlag())
            model.setOut_type_id(domain.getOut_type_id());
         if(domain.getManu_type_idDirtyFlag())
            model.setManu_type_id(domain.getManu_type_id());
         if(domain.getPbm_mto_pull_idDirtyFlag())
            model.setPbm_mto_pull_id(domain.getPbm_mto_pull_id());
         if(domain.getMto_pull_idDirtyFlag())
            model.setMto_pull_id(domain.getMto_pull_id());
         if(domain.getSam_type_idDirtyFlag())
            model.setSam_type_id(domain.getSam_type_id());
         if(domain.getManufacture_pull_idDirtyFlag())
            model.setManufacture_pull_id(domain.getManufacture_pull_id());
         if(domain.getSam_loc_idDirtyFlag())
            model.setSam_loc_id(domain.getSam_loc_id());
         if(domain.getBuy_pull_idDirtyFlag())
            model.setBuy_pull_id(domain.getBuy_pull_id());
         if(domain.getInt_type_idDirtyFlag())
            model.setInt_type_id(domain.getInt_type_id());
         if(domain.getWh_qc_stock_loc_idDirtyFlag())
            model.setWh_qc_stock_loc_id(domain.getWh_qc_stock_loc_id());
         if(domain.getIn_type_idDirtyFlag())
            model.setIn_type_id(domain.getIn_type_id());
         if(domain.getPbm_route_idDirtyFlag())
            model.setPbm_route_id(domain.getPbm_route_id());
         if(domain.getPick_type_idDirtyFlag())
            model.setPick_type_id(domain.getPick_type_id());
         if(domain.getCreate_uidDirtyFlag())
            model.setCreate_uid(domain.getCreate_uid());
         if(domain.getPartner_idDirtyFlag())
            model.setPartner_id(domain.getPartner_id());
         if(domain.getCompany_idDirtyFlag())
            model.setCompany_id(domain.getCompany_id());
         if(domain.getReception_route_idDirtyFlag())
            model.setReception_route_id(domain.getReception_route_id());
         if(domain.getPack_type_idDirtyFlag())
            model.setPack_type_id(domain.getPack_type_id());
         if(domain.getPbm_type_idDirtyFlag())
            model.setPbm_type_id(domain.getPbm_type_id());
         if(domain.getDelivery_route_idDirtyFlag())
            model.setDelivery_route_id(domain.getDelivery_route_id());
         if(domain.getWh_input_stock_loc_idDirtyFlag())
            model.setWh_input_stock_loc_id(domain.getWh_input_stock_loc_id());
         if(domain.getLot_stock_idDirtyFlag())
            model.setLot_stock_id(domain.getLot_stock_id());
         if(domain.getSam_rule_idDirtyFlag())
            model.setSam_rule_id(domain.getSam_rule_id());
         if(domain.getCrossdock_route_idDirtyFlag())
            model.setCrossdock_route_id(domain.getCrossdock_route_id());
         if(domain.getWh_pack_stock_loc_idDirtyFlag())
            model.setWh_pack_stock_loc_id(domain.getWh_pack_stock_loc_id());
        return model ;
    }

    public Stock_warehouse convert2Domain( Istock_warehouse model ,Stock_warehouse domain) {
        if(model == null)
            return domain ;
        if(domain == null){
            domain = new Stock_warehouse();
        }

        if(model.getResupply_route_idsDirtyFlag())
            domain.setResupply_route_ids(model.getResupply_route_ids());
        if(model.getActiveDirtyFlag())
            domain.setActive(model.getActive());
        if(model.getResupply_wh_idsDirtyFlag())
            domain.setResupply_wh_ids(model.getResupply_wh_ids());
        if(model.getWrite_dateDirtyFlag())
            domain.setWrite_date(model.getWrite_date());
        if(model.get__last_updateDirtyFlag())
            domain.set__last_update(model.get__last_update());
        if(model.getNameDirtyFlag())
            domain.setName(model.getName());
        if(model.getDelivery_stepsDirtyFlag())
            domain.setDelivery_steps(model.getDelivery_steps());
        if(model.getWarehouse_countDirtyFlag())
            domain.setWarehouse_count(model.getWarehouse_count());
        if(model.getManufacture_to_resupplyDirtyFlag())
            domain.setManufacture_to_resupply(model.getManufacture_to_resupply());
        if(model.getCreate_dateDirtyFlag())
            domain.setCreate_date(model.getCreate_date());
        if(model.getRoute_idsDirtyFlag())
            domain.setRoute_ids(model.getRoute_ids());
        if(model.getDisplay_nameDirtyFlag())
            domain.setDisplay_name(model.getDisplay_name());
        if(model.getReception_stepsDirtyFlag())
            domain.setReception_steps(model.getReception_steps());
        if(model.getBuy_to_resupplyDirtyFlag())
            domain.setBuy_to_resupply(model.getBuy_to_resupply());
        if(model.getIdDirtyFlag())
            domain.setId(model.getId());
        if(model.getCodeDirtyFlag())
            domain.setCode(model.getCode());
        if(model.getManufacture_stepsDirtyFlag())
            domain.setManufacture_steps(model.getManufacture_steps());
        if(model.getShow_resupplyDirtyFlag())
            domain.setShow_resupply(model.getShow_resupply());
        if(model.getView_location_id_textDirtyFlag())
            domain.setView_location_id_text(model.getView_location_id_text());
        if(model.getWh_input_stock_loc_id_textDirtyFlag())
            domain.setWh_input_stock_loc_id_text(model.getWh_input_stock_loc_id_text());
        if(model.getSam_loc_id_textDirtyFlag())
            domain.setSam_loc_id_text(model.getSam_loc_id_text());
        if(model.getCrossdock_route_id_textDirtyFlag())
            domain.setCrossdock_route_id_text(model.getCrossdock_route_id_text());
        if(model.getPbm_route_id_textDirtyFlag())
            domain.setPbm_route_id_text(model.getPbm_route_id_text());
        if(model.getWrite_uid_textDirtyFlag())
            domain.setWrite_uid_text(model.getWrite_uid_text());
        if(model.getPbm_type_id_textDirtyFlag())
            domain.setPbm_type_id_text(model.getPbm_type_id_text());
        if(model.getPick_type_id_textDirtyFlag())
            domain.setPick_type_id_text(model.getPick_type_id_text());
        if(model.getInt_type_id_textDirtyFlag())
            domain.setInt_type_id_text(model.getInt_type_id_text());
        if(model.getManu_type_id_textDirtyFlag())
            domain.setManu_type_id_text(model.getManu_type_id_text());
        if(model.getBuy_pull_id_textDirtyFlag())
            domain.setBuy_pull_id_text(model.getBuy_pull_id_text());
        if(model.getWh_pack_stock_loc_id_textDirtyFlag())
            domain.setWh_pack_stock_loc_id_text(model.getWh_pack_stock_loc_id_text());
        if(model.getManufacture_pull_id_textDirtyFlag())
            domain.setManufacture_pull_id_text(model.getManufacture_pull_id_text());
        if(model.getReception_route_id_textDirtyFlag())
            domain.setReception_route_id_text(model.getReception_route_id_text());
        if(model.getDelivery_route_id_textDirtyFlag())
            domain.setDelivery_route_id_text(model.getDelivery_route_id_text());
        if(model.getSam_type_id_textDirtyFlag())
            domain.setSam_type_id_text(model.getSam_type_id_text());
        if(model.getPartner_id_textDirtyFlag())
            domain.setPartner_id_text(model.getPartner_id_text());
        if(model.getOut_type_id_textDirtyFlag())
            domain.setOut_type_id_text(model.getOut_type_id_text());
        if(model.getMto_pull_id_textDirtyFlag())
            domain.setMto_pull_id_text(model.getMto_pull_id_text());
        if(model.getCreate_uid_textDirtyFlag())
            domain.setCreate_uid_text(model.getCreate_uid_text());
        if(model.getLot_stock_id_textDirtyFlag())
            domain.setLot_stock_id_text(model.getLot_stock_id_text());
        if(model.getPbm_mto_pull_id_textDirtyFlag())
            domain.setPbm_mto_pull_id_text(model.getPbm_mto_pull_id_text());
        if(model.getCompany_id_textDirtyFlag())
            domain.setCompany_id_text(model.getCompany_id_text());
        if(model.getPbm_loc_id_textDirtyFlag())
            domain.setPbm_loc_id_text(model.getPbm_loc_id_text());
        if(model.getPack_type_id_textDirtyFlag())
            domain.setPack_type_id_text(model.getPack_type_id_text());
        if(model.getSam_rule_id_textDirtyFlag())
            domain.setSam_rule_id_text(model.getSam_rule_id_text());
        if(model.getIn_type_id_textDirtyFlag())
            domain.setIn_type_id_text(model.getIn_type_id_text());
        if(model.getWh_output_stock_loc_id_textDirtyFlag())
            domain.setWh_output_stock_loc_id_text(model.getWh_output_stock_loc_id_text());
        if(model.getWh_qc_stock_loc_id_textDirtyFlag())
            domain.setWh_qc_stock_loc_id_text(model.getWh_qc_stock_loc_id_text());
        if(model.getWh_output_stock_loc_idDirtyFlag())
            domain.setWh_output_stock_loc_id(model.getWh_output_stock_loc_id());
        if(model.getWrite_uidDirtyFlag())
            domain.setWrite_uid(model.getWrite_uid());
        if(model.getPbm_loc_idDirtyFlag())
            domain.setPbm_loc_id(model.getPbm_loc_id());
        if(model.getView_location_idDirtyFlag())
            domain.setView_location_id(model.getView_location_id());
        if(model.getOut_type_idDirtyFlag())
            domain.setOut_type_id(model.getOut_type_id());
        if(model.getManu_type_idDirtyFlag())
            domain.setManu_type_id(model.getManu_type_id());
        if(model.getPbm_mto_pull_idDirtyFlag())
            domain.setPbm_mto_pull_id(model.getPbm_mto_pull_id());
        if(model.getMto_pull_idDirtyFlag())
            domain.setMto_pull_id(model.getMto_pull_id());
        if(model.getSam_type_idDirtyFlag())
            domain.setSam_type_id(model.getSam_type_id());
        if(model.getManufacture_pull_idDirtyFlag())
            domain.setManufacture_pull_id(model.getManufacture_pull_id());
        if(model.getSam_loc_idDirtyFlag())
            domain.setSam_loc_id(model.getSam_loc_id());
        if(model.getBuy_pull_idDirtyFlag())
            domain.setBuy_pull_id(model.getBuy_pull_id());
        if(model.getInt_type_idDirtyFlag())
            domain.setInt_type_id(model.getInt_type_id());
        if(model.getWh_qc_stock_loc_idDirtyFlag())
            domain.setWh_qc_stock_loc_id(model.getWh_qc_stock_loc_id());
        if(model.getIn_type_idDirtyFlag())
            domain.setIn_type_id(model.getIn_type_id());
        if(model.getPbm_route_idDirtyFlag())
            domain.setPbm_route_id(model.getPbm_route_id());
        if(model.getPick_type_idDirtyFlag())
            domain.setPick_type_id(model.getPick_type_id());
        if(model.getCreate_uidDirtyFlag())
            domain.setCreate_uid(model.getCreate_uid());
        if(model.getPartner_idDirtyFlag())
            domain.setPartner_id(model.getPartner_id());
        if(model.getCompany_idDirtyFlag())
            domain.setCompany_id(model.getCompany_id());
        if(model.getReception_route_idDirtyFlag())
            domain.setReception_route_id(model.getReception_route_id());
        if(model.getPack_type_idDirtyFlag())
            domain.setPack_type_id(model.getPack_type_id());
        if(model.getPbm_type_idDirtyFlag())
            domain.setPbm_type_id(model.getPbm_type_id());
        if(model.getDelivery_route_idDirtyFlag())
            domain.setDelivery_route_id(model.getDelivery_route_id());
        if(model.getWh_input_stock_loc_idDirtyFlag())
            domain.setWh_input_stock_loc_id(model.getWh_input_stock_loc_id());
        if(model.getLot_stock_idDirtyFlag())
            domain.setLot_stock_id(model.getLot_stock_id());
        if(model.getSam_rule_idDirtyFlag())
            domain.setSam_rule_id(model.getSam_rule_id());
        if(model.getCrossdock_route_idDirtyFlag())
            domain.setCrossdock_route_id(model.getCrossdock_route_id());
        if(model.getWh_pack_stock_loc_idDirtyFlag())
            domain.setWh_pack_stock_loc_id(model.getWh_pack_stock_loc_id());
        return domain ;
    }


}
